__author__ = 'jiangning'
from django.conf.urls import url,include
from forums.views import index,userprofile,userinfo,publish,comment,resume,timeaxis,friendship
from django.conf import settings
from django.conf.urls.static import static
from django.views.static import serve



urlpatterns = [
        # url(r'^$',home,name='home'),
        url(r'^$',index,name='index'),
        url(r'^avatar/', include('avatar.urls')),
        url(r'^pcenter/',userprofile,name='pcenter'),
        url(r'^userinfo/',userinfo,name='userinfo'),
        url(r'^publish/$',publish,name='publish'),
        url(r'^comments/(?P<id>\d+)/$',comment,name = 'comment'),
        url(r'^myresume/$',resume,name='resume'),
        url(r'^timeaxis/$',timeaxis,name='timeaxis'),
        url(r'^friendship/$',friendship,name='friendship'),

        # url(r'^$',IndexView.as_view(),name='home',kwargs={'page_num':1}),
        # url(r'^article/(?P<slug>\w+).html$',ArticleView.as_view()),
        # url(r'^all/$',AllView.as_view()),
        # url(r'^search/$',SearchView.as_view()),
        # url(r'^login/$',TemplateView.as_view(template_name="blog/login.html")),
        # url(r'^register/$',TemplateView.as_view(template_name="blog/register.html")),
        # url(r'^forgetpassword/$',TemplateView.as_view(template_name="blog/forgetpassword.html")),
        # url(r'^resetpassword/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',TemplateView.as_view(template_name="blog/resetpassword.html")),
        # url(r'^column/(?P<column>\w+)$',ColumnView.as_view()),
        # url(r'^user/(?P<slug>\w+)$',UserView.as_view()),
        # url(r'^news/$',NewsView.as_view()),
        # url(r'^news/(?P<pk>\w+)$',DetailView.as_view(model=News)),
        # url(r'^tag/(?P<tag>\w+)/$',TagView.as_view()),
        # url(r'^category/(?P<category>\w+)/$',CategoryView.as_view()),
]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    urlpatterns += [
        url(r'^media/(?P<path>.*)$', serve, {
            'document_root': settings.MEDIA_ROOT,
        }),
   ]
